package com.xfgg.cloud.boot.config.redis;

import com.xfgg.cloud.boot.config.redis.JedisConfig;
import com.xfgg.cloud.boot.jedis.JedisClusterPipeLine;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xfgg
 */
@Configuration
public class RedisConfig {
    @Bean(name = "redisDao")
    public JedisClusterPipeLine suggestCacheAdDao(@Value("${redisMaxWait}") int maxActive,
                                                  @Value("${redisMaxIdle}") int maxIdle,
                                                  @Value("${redisMaxActive}") int maxWait,
                                                  @Value("${redisRedisAddr}") String redisAdders) {

        return JedisConfig.initJedisClusterPipeline(maxActive, maxIdle, maxWait, redisAdders);
    }
}
